<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>总代理管理登录</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<%@include file="/WEB-INF/base.jspf"%>
<style type="text/css">
</style>
</head>
<body style="background: #f5f5f5c2;">
	<div style="margin:0 calc(50% - 200px); text-align: center;width:400px;margin-top: 20vh;">
		<h3 style="color:#555;margin-bottom: 20px;">总代理管理系统</h3>
		<div style="background:#E3E3E3;border-radius: 5px;border:1px solid #d2cfcf;padding:30px 15px;">
			<div class="input-group input-group-lg">
				<span class="input-group-addon"><span class="glyphicon glyphicon-user" style="color: #AF3836;"></span></span>
				<input class="form-control" id="input-i-name" value="" />
			</div>
			<div class="input-group input-group-lg" style="margin: 30px 0;">
				<span class="input-group-addon"><span class="glyphicon glyphicon-lock" style="color: #AF3836;"></span></span>
				<input class="form-control" id="input-i-pass" type="password" value="" />
			</div>
			<button class="btn btn-lg btn-primary" id="button-i-loginNow" style="width: 50%;">登　录</button>
		</div>
	</div>
	<div class="col-xs-4"></div>
	
	<div style="position: fixed;bottom: 10px;width: 100%;text-align: center;">
		<p>© Copyright 2017-2028 All Rights Reserved 大发国际彩票娱乐城 </p>
	</div>
<script>
		$("#button-i-loginNow").on("click", function(event) {
			var nValue = $("#input-i-name").val()
			var pValue = $("#input-i-pass").val()
			if (!nValue) {
				alert("无效的用户名")
				return
			}
			if (!pValue) {
				alert("无效的密码")
				return
			}			
			var newRequest = {
				url: "/userAgent/doLogin.do",
				type: "post",
				data: {
					name: nValue,
					pass: pValue,
				},
				success: function(data) {
					var newData = JSON.parse(data)
					var message = newData.message
					if (message != "1") {
						alert(newData.data)
						$("#input-i-pass").val("")
						return
					}
					location.href ="/userAgent/index.do"
				},
				error: function(status) {
					alert("网络异常，请稍后重试")
				}
			}
			ajax(newRequest)			
		})
	</script>
</body>
</html>